//commandRun.h

#pragma once
#ifndef COMMANDRUN_H
#define COMMANDRUN_H

#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include "taskStorage.h"
#include "task.h"
#include "taskFunction.h"

class CommandRun {
private:
	
	enum COMMAND_TYPE {
		ADD, DELETE, SEARCH, SORT, EXIT, INVALID, EDIT, COMPLETE, SHOWCOMPLETE, SHOWNCOMPLETE, DISPLAY
	};

	static const std::string CMD_ADD;
	static const std::string CMD_EDIT;
	static const std::string CMD_DELETE;
	static const std::string CMD_DISPLAY;
	static const std::string CMD_EXIT;
	static const std::string CMD_SEARCH;
	static const std::string CMD_COMPLETE;
	static const std::string CMD_SHOWCOMPLETE;
	static const std::string CMD_SHOWNCOMPLETE;
	static const std::string CMD_USERPROMPT;

	std::istringstream _inputStream;
	TaskStorage *_file;
	std::vector<Task> taskList;
	TaskFunction _cmdOperation;
public:
	CommandRun();
	void ProgramLaunch();
	COMMAND_TYPE determineCommand(std::string);
	std::string executeCommand(std::string);

};

#endif